<template>
  <div>
    <el-dropdown trigger="click" @command="handleCommand">
      <el-button size="small" class="mr15">{{desc.title}}</el-button>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item v-for="(item,index) in desc.items" :key="index"  :command="item">{{item}}</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>
<script>
export default {
  name: 'dropdown',
  data() {
    return {
    };
  },
  props: ['desc'],
  methods: {
    handleCommand(command) {
       let obj = {
        key: this.desc.title,
        value: command
      };
      this.$emit('output', obj);
    }
  }
};
</script>
<style lang="scss" scoped>
</style>
